<template>
  <div class="container">
    <Home v-if="active === 'home'"></Home>
    <Info v-else-if="active === 'info'"></Info>
    <div>
      <van-tabbar route>
        <van-tabbar-item replace to="/home" icon="home-o">首页</van-tabbar-item>
        <van-tabbar-item replace to="/info" icon="user-o">我的</van-tabbar-item>
      </van-tabbar>
    </div>
  </div>
</template>

<script>
import Home from "./home.vue";
import Info from "../info/index.vue";
export default {
  name: "Main",
  components: {
    Home,
    Info,
  },
  data() {
    return {
      active: "",
    };
  },
  created() {
    console.log(this.$route)
    this.active = this.$route.name
  },
  methods: {},
};
</script>

<style lang="less" scoped>
// .container {
// }
</style>